﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductsSameDepartment.ascx.cs" Inherits="Controls_ProductsSameDepartment" %>
<%@ Register src="AllowPagingDataList.ascx" tagname="AllowPagingDataList" tagprefix="uc1" %>
<%@ Import Namespace="DTO" %>
<script src="<%=Globals.ApplicationPath%>Jquery/jquery.js" type="text/javascript"></script>
<script src="<%=Globals.ApplicationPath%>Jquery/main.js" type="text/javascript"></script>

<style>
#screenshot{	position:absolute;	border:1px solid #ccc;	background:#333;	padding:5px;	display:none;	color:#fff;	}
    a:hover 
    {
    	color:Black;
   }	
</style>

    <asp:DataList ID="dtlProducts" EnableTheming="False" runat="server"
       DataKeyField="ID" GridLines="None" Width="100%" RepeatColumns="3" 
    BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
    CellPadding="4" ForeColor="Black">
       <SelectedItemStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
       <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
       <ItemTemplate>
            <table cellpadding="6" cellspacing="6" >
                <tr>
                    <td class="titleProduct" align="center">
                        <a href='<%#Globals.ApplicationPath%>Products/<%#Eval("ID")%>/<%#Utils.ConvertToUnSign(DataBinder.Eval(Container.DataItem, "Title").ToString())%>.aspx'/>
                            <%#Eval("Title")%>
                        </a>                    
                    <asp:Image ID="Image2" ImageUrl="~/Images/imgNew.gif" runat="server" Visible='<%# Eval("IsNews") %>' />
                    </td>
                </tr>
                <tr>
                    <td align="center">
	                    <a href='<%#Globals.ApplicationPath%>Products/<%#Eval("ID")%>/<%#Utils.ConvertToUnSign(DataBinder.Eval(Container.DataItem, "Title").ToString())%>.aspx' class="screenshot" rel='<%#Eval("FullImageUrl") %>'>
                            <img src='<%#Eval("SmallImageUrl")%>' width="140px" alt="gallery thumbnail" />
                        </a>
                    </td>
                 </tr>
                <tr>
                    <td align="center">
                    <asp:Panel ID="Panel1" runat="server" Visible='<%# (int)Eval("DiscountPercentage") > 0 %>'>
                        <s>Giá : <asp:Label runat="server" ID="lblGia" ForeColor="Red" Text='<%#Eval("StringUnitPrice")%>' /></s><br />
                        Giảm : <asp:Label runat="server" ID="lblGiamgia" ForeColor="Red" Text='<%#Eval("FinalUnitPrice")+"%"%>' /><br />
                        Giá khuyến mãi : <asp:Label runat="server" ID="Label1" ForeColor="Red" Text='<%#Eval("StringDiscountPercentage")%>' />
                    </asp:Panel>
                    <asp:Panel ID="Panel2" runat="server" Visible='<%# (int)Eval("DiscountPercentage") <= 0 %>'>
                        Giá : <asp:Label runat="server" ID="lblGiamoi" ForeColor="Red" Text='<%#Eval("StringUnitPrice")%>' /><br />
                    </asp:Panel>
                        <a href='<%#Globals.ApplicationPath%>Products/<%#Eval("ID")%>/<%#Utils.ConvertToUnSign(DataBinder.Eval(Container.DataItem, "Title").ToString())%>.aspx'/>
                            chi tiết
                        </a>
                        <div class="details">
                            <a href='<%#Globals.ApplicationPath%>ShoppingCart.aspx?ID=<%#Eval("ID")%>'/>
                               MUA NGAY
                            </a>
                        </div>
                    </td>
                </tr>
            </table>      
       </ItemTemplate>
       <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
       <ItemStyle BorderColor="Orange" />
    </asp:DataList>
<asp:ObjectDataSource runat="server" ID="objAllProduct" TypeName="BLL.Store.Product" SelectMethod="ListProductSameDeparment">
    <SelectParameters>
        <asp:QueryStringParameter Name="productID" QueryStringField="ID" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
    <uc1:AllowPagingDataList ID="AllowPagingDataList1" runat="server" />
    <asp:Literal runat="server" ID="lblText" />